home *** CD-ROM | disk | FTP | other *** search
/ Floppyshop 2 / Floppyshop - 2.zip / Floppyshop - 2.iso / diskmags / 0022-3.564 / dmg-0055 / 523.txt < prev    next >
Text File  |  1997-04-16  |  10KB  |  258 lines

  1. Via:      UK.AC.EARN-RELAY; 16 OCT 89 10:58:21 GMT  
  2. Received: from UKACRL by UK.AC.RL.IB (Mailer X1.25) with BSMTP id 6599; Sun, 15
  3.           Oct 89 22:13:04 BS
  4. Received: from CEARN.cern.ch by UKACRL.BITNET (Mailer X1.25) with BSMTP id
  5.           4741; Sun, 15 Oct 89 22:13:03 B
  6. Received: by CEARN (Mailer R2.03B) id 2128; Sun, 15 Oct 89 22:13:24 GVA
  7. Date:     Sun, 15 Oct 89 15:00:11 MDT
  8. Reply-To: INFO-ATARI16@MIL.ARMY.WSMR-SIMTEL20
  9. Sender:   INFO-ATARI16 Discussion <INFO-A16@EARN.DEARN>
  10. Comments: Warning -- original Sender: tag was INFO-A16@MARIST
  11. From:     INFO-ATARI16-REQUEST@MIL.ARMY.WSMR-SIMTEL20
  12. Subject:  INFO-ATARI16 Digest V89 #523
  13. Comments: To: INFO-ATARI16@WSMR-SIMTEL20.ARMY.MIL
  14.  
  15. INFO-ATARI16 Digest         Sun, 15 Oct 89       Volume 89 : Issue 523
  16.  
  17. Today's Topics:
  18.                       Laser C and FAST Problems
  19.                       SQL Database Access from C
  20.                             TOS problem ?
  21. ----------------------------------------------------------------------
  22.  
  23. Date: 15 Oct 89 19:16:59 GMT
  24. From:
  25.  gem.mps.ohio-state.edu!usc!merlin.usc.edu!nunki.usc.edu!jjung@tut.cis.ohio-stat
  26. e.edu  (John Jung)
  27. Subject: Laser C and FAST Problems
  28.  
  29.   I have a question for all you hard drive and Laser C owners out there.
  30.  
  31.   Recently, I got an ICD FAST 50 meg hard drive. It performs fine, with the
  32. exception that I can't run any software off the floppy (a 1040STfm) unless the
  33. hard drive is on, and I disable the HD (using Shift-Control-Alt). Other people
  34. have told me that the controller is a little flaky for this reason, but I'm not
  35. worrying about it much, because it's only a slight hassle.
  36.  
  37.   Now for my problem. I have Laser C 2.0 on the hard drive, and I use it fairly
  38. frequently. The problem is, whenever I do hard drive access with Laser C,
  39. occassionally, the mouse will die on me, in that I can't move the mouse
  40. pointer. Sometimes, the mouse's death is only minor, and I can use the keyboard
  41. controls to control the pointer and leave Laser C, and sometimes the death is
  42. major and nothing will move the mouse, in which case I simply have to reboot
  43. the whole system.
  44.  
  45.   I have noticed that before the mouse dies, a string of characters (same
  46. character in the string, but not the same character all the time) comes out on
  47. the active Laser C window, and then Laser C pops up a dialog saying that I
  48. should hit a key that is recognized by Laser C. Then the mouse dies.
  49.  
  50.   The mouse dying only happens with Laser C and not with other programs I use,
  51. like Flash! or WordUp!.
  52.  
  53.   I use Superboot 5.5A along with the other ICD utilities (clock and boot up
  54. program) to boot up my system. Also, I have no busy light (I can't get it to
  55. work), and the hard drive seems to do occassional disk access, but I'm not
  56. sure.
  57.  
  58.   What I want to know, is : Is this problem with Laser C common with other HD
  59. users? With other FAST users? Or is it that my HD controller is flakier than I
  60. thought, and that's what's causing all the problems (HD has to be on, to run
  61. floppy, random HD access, and Laser C mouse death)? Or do I have an HD virus?
  62.  
  63.   Please post or E-mail and help you can give.
  64.  
  65.                         John
  66.  
  67. ------------------------------
  68.  
  69. Date: 15 Oct 89 18:13:28 GMT
  70. From: galaxy.rutgers.edu!argus!ron@rutgers.edu  (Ron DeBlock)
  71. Subject: SQL Database Access from C
  72.  
  73. A few days ago, I promised to post an article demostrating how to
  74. use Regent Software's SQL Add-On with C.  Sorry for the delay -
  75. my ST was at my dealer getting TOS 1.4 installed (yay!).
  76.  
  77. I needed a cheap database for a school project, and I found SQL Add-On
  78. in E. Arthur Brown's catalog for $24.95.  I preferred something I could
  79. use with Mark Williams C, but decided that GFA Basic would be OK.
  80.  
  81. The SQL Add-On works well, but the documentation is not great and the
  82. SQL is not standard.  Syntax is slightly different and it has a funky
  83. way of dealing with queries returning multiple rows.  However, the
  84. price is right.
  85.  
  86. Regent claims that files are compatible with RegentBase.  It is
  87. supposed to work with GFA Basic V2 and V3.
  88.  
  89. The Add-On is a terminate-and-stay-resident program (TSR).  It loads
  90. the SQL processor and adds a new xbios call (xbios(500)).  It takes up
  91. over 300 K of ram (buffers, I guess).
  92.  
  93. To use the Add-On, run the TSR program first.  Use GFA Basic's xbios()
  94. call to call xbios(500).  This returns the address of the SQL processing
  95. function.   The GFA Call function is then used to execute SQL statements.
  96.  
  97. I reasoned that there is nothing preventing me from doing the same thing
  98. in Mark Williams C.  In C, if you know the address of a function, you
  99. can call it.
  100.  
  101. By reading the GFA Basic and MWC manuals, and spending some time with the
  102. MWC debugger, I worked it out.  The SQL function expects two arguments
  103. on the stack:
  104.     number of arguments (int, on top of stack)
  105.     arguement buffer (pointer to array of pointers to char buffers)
  106.  
  107. Below is a sample C program with comments.  Feel free to email if you have
  108. questions (email may no work - post here or use snail mail in that case).
  109.  
  110.  
  111. Regent Software
  112. PO Box 14628
  113. Long Beach, CA 90803-1208
  114. (213) 439-9664
  115.  
  116. E. Arthur Brown
  117. 3404 Pawnee Drive
  118. Alexandria, MN 56308
  119. (612) 762-8847
  120.  
  121. -----------------------------------------
  122.  
  123. /*
  124.    Demonstration of using Regent SQL Add-On for GFA Basic with Mark Williams
  125.    C.
  126.  
  127.    Copyright 1989 by Ronald J. DeBlock, Jr.
  128.    May be used or distributed freely as long as this copyright notice
  129.    is included.
  130. */
  131.  
  132. #include <stdio.h>
  133.  
  134. main()
  135. ?
  136.     /* pointer to function */
  137.     typedef void (*PFI)();
  138.  
  139.     extern long xbios();
  140.  
  141.     /* sql is a pointer to a function returning void */
  142.     PFI sql;
  143.  
  144.     /* these char arrays hold arguments for the sql call */
  145.     /* fields */
  146.     char field1[21], field2[3], field3[21];
  147.     /* error code */
  148.     char error[10];
  149.     /* command string */
  150.     char command[100];
  151.  
  152.     /* this array will hold pointers to the command, error and field
  153.     arguments.  Make the array larger if more fields are used. */
  154.     char *args[5];
  155.  
  156.     /* the first field in the array points to SQL command string */
  157.     args[0] = command;
  158.     /* second points to a buffer used to return error codes */
  159.     args[1] = error;
  160.     /* all other fields point to buffers where the column results
  161.        of a query will be placed - one buffer per culumn returned */
  162.     args[2] = field1;
  163.     args[3] = field2;
  164.     args[4] = field3;
  165.  
  166.     /* A program is run before the SQL Add-On can be used.  It
  167.        loads the SQL processor and creates a new xbios call.
  168.        The new xbios call returns the address of the SQL processing
  169.        routine. */
  170.     sql = (PFI)xbios(500);
  171.     printf("sql = %U\n",(long)sql);
  172.  
  173.  
  174.     /* This program assumes that a table has been created using the
  175.        SQL statement
  176.          CREATE TABLE phonelist name CHAR(20), age INT(2),
  177.             phone CHAR(20);
  178.       and some records have been added.  The demo program included with
  179.       the product (written in GFA Basic) will do this.  */
  180.  
  181.     /* set up the command string - SELECT [1] is Regent's funky
  182.        way of setting up a cursor */
  183.     strcpy(command,"SELECT [1] * FROM phonelist;");
  184.  
  185.     /* Call the SQL processor.  The function expects to see the
  186.     number of arguments on the top of the stack, followed by a
  187.     pointer to the argument array.
  188.         *** WARNING ***
  189.     This is compiler dependent!! Mark Williams C pushes arguments
  190.     right to left.  Your compiler may differ.  If so, reverse the
  191.     order of the arguments and it should work. */
  192.  
  193.     (*sql)(5,args);
  194.     printf("error: %s\n",error);
  195.     printf("%s   %s   %s\n",field1, field2, field3);
  196.  
  197.     /* execute another commend to retrieve the next row.
  198.        SELECT NEXT is Regent's funky way of dealing with cursors */
  199.     strcpy(command,"SELECT NEXT * FROM phonelist;");
  200.     (*sql)(5,args);
  201.     printf("error: %s\n",error);
  202.     printf("%s   %s   %s\n",field1, field2, field3);
  203. ?
  204.  
  205.  
  206. -------------------------------------
  207. --
  208. Ron DeBlock    N2JSO
  209. Net: ...!rutgers!galaxy!argus
  210. US Mail: 42 Davis Street, Phillibsburg, NJ 08865 USA
  211.  
  212. ------------------------------
  213.  
  214. Date: 15 Oct 89 15:29:10 GMT
  215. From: mcsun!hp4nl!ruuinf!piet@uunet.uu.net  (Piet van Oostrum)
  216. Subject: TOS problem ?
  217.  
  218. I encountered a strange TOS behaviour (TOS 1.2):
  219.  
  220. I Fcreate a file, then Fopen the same file (not very usual, I agree). I get
  221. two filehandles of course. I only use the second one, and write some bytes
  222. to the file. Finally I close the second handle, and forget to close the
  223. first one, (or close that last). Result: an empty file. If the first
  224. filehandle is closed first, no problem.
  225.  
  226. My guess is that the close on the first filehandle (either implicit or
  227. explicit) remembers that nothing has been written on this handle, so the
  228. file should be empty (???)
  229.  
  230. Note: the compiler has long ints (GCC).
  231.  
  232. Any comments? Is this a bug? Here is the program:
  233.  
  234. ------------------------------------------------------------------------
  235. #include <osbind.h>
  236. char fname[] = "test.fil";
  237. char message[] = "this is a line\n";
  238. main()
  239. ?
  240.     int fd1, fd2, r;
  241.  
  242.     fd1 = Fcreate(fname, 0);
  243.     fd2 = Fopen(fname, 1);
  244.     r = Fwrite(fd2, strlen(message), message);
  245.     printf ("fd1=%d,fd2=%d,result=%d\n",fd1,fd2,r);
  246.     Fclose (fd2);
  247.     Fclose (fd1); /* or just delete this line */
  248. ?
  249. --------------------------------------------------------------------------
  250. Piet van Oostrum, Dept of Computer Science, University of Utrecht
  251. Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht,  The Netherlands.
  252. Telephone: +31-30-531806      Internet: piet@cs.ruu.nl
  253. Telefax:   +31-30-513791      Uucp: uunet!mcsun!hp4nl!ruuinf!piet
  254.  
  255. ------------------------------
  256.  
  257. End of INFO-ATARI16 Digest V89 Issue #523
  258. *****************************************